home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
zbpc_460.zip
/
TUTOR.EXE
/
GRAPH1.DOC
< prev
next >
Wrap
Text File
|
1988-11-14
|
2KB
|
52 lines
ZBASIC Graphics
...
ZBASIC graphics are different from other graphics schemes in
that they are "Device-Independent". This means that they are
done in a standardized format which can be transferred from
machine to machine ... that is a program written for the IBM
and ported over to the TRS-80 will display the same graphics
image adjusted for the resolution of the screen of that machine.
Also, conversion of graphics on the IBM from EGA to CGA to
Hercules is as simple as identifying the type of display, and
there is a special command for that. Also, for the IBM &
Macintosh the coordinate system can be altered, or set to
absolute pixel addressing by COORDINATE or COORDINATE WINDOW.
...
ZBASIC uses a "Theoretical Palette" with 1024 horizontal and
768 vertical pixels. Coordinates outside this range (from 8192
to -8192) are supported, though they will not display on the
screen. The MODE Command is used to define the specific graphic
card or machine to be addressed.
...
Thus to draw a diagonal line the commands would be:
100 X=CARDTYPE:IFX=255PRINT"No Graphics Card":END
110 IFX=3 MDE=20 REM Set to Hercules
120 IFX=0 MDE=7 REM Set to 640x200 CGA, MODE5 for 320x200
130 IFX=1 MDE=19 REM EGA Color monitor, X=2 would be EGA Mono
140 MODE MDE : PLOT0,0TO1023,767 REM Draw the line
...
This would determine the type of monitor, set the MODE and
draw the same line for each type of monitor. If we wanted to
move this image to a KAYPRO CP/M with graphics we would omit
the CARDTYPE lines 100-130 and enter ---
...
140 MODE3 : PLOT0,0TO1023,767
This would select 120x72 graphics, or MODE 7 would select
160x100 graphics. If this were a TRS-80 without a graphics
board MODE 7 would select 128x48 (Model I & 3) or 160x72
(Model 4).
The PLOT command can be used as a single statement PLOT 20,4
or to draw a line PLOT0,0TO100,100 or as a multiple command
PLOT 10,10TO20,20TO100,400 or from the previous position
PLOT TO100,50.
...
POINT (X,Y) will also return the color of that coordinate.
...
BOX and CIRCLE (with RATIO for perspective) are supported,
along with FILL and COLOR (for color machines).
PRINT%(X,Y) and INPUT%(X,Y) are offered for text positioning
within graphic modes.